package atm05;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 取款
 */
public class GetPanel extends JPanel{
    private JLabel input = new JLabel("请输入您的取款金额：");
    private JTextField inputText = new JTextField();
    private JButton sureBtn = new JButton(new ImageIcon("src/atm05/Images/buttonSure.jpg"));
    private JButton exitBtn = new JButton(new ImageIcon("src/atm05/Images/buttonOff.jpg"));
    private Font font = new Font("黑体",Font.BOLD,25);

    public GetPanel(ATM05 atm05) {
        this.setLayout(null);

        input.setBounds(320,250,250,50);
        input.setFont(font);

        inputText.setBounds(550,250,200,50);
        inputText.setFont(font);

        sureBtn.setBounds(420,320,140,50);

        exitBtn.setBounds(880,380,140,50);
        exitBtn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                atm05.showPanel("menu");
            }
        });

        this.add(input);
        this.add(inputText);
        this.add(sureBtn);
        this.add(exitBtn);

        this.setOpaque(false);
    }
}
